<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script src="./027浅拷贝.js"></script>
    <script>
        const obj={x:'abc',y:{m:1}}
        const result=clone1(obj)
        console.log(result);
        result.y.m='c'   //对新的对象做了修改 原来的数据发生改变
        const result2=clone2(obj)
        console.log(result2);
    </script>
</body>
</html>